const Status = [{ name:'待审核', value:0 },{ name:'已审核', value:1 },{ name:'已作废', value:-1 },{ name:'待完善', value:2 },{ name:'全部', value:-99 },{ name:'异常', value:-2}]
const CardType=[{ name:'护照', value:0 },{ name:'军官证', value:1 },{ name:'港澳居民通行证', value:2 },{ name:'台湾居民通行证', value:3 },
	{ name:'港澳居民来往内地通行证', value:4 },{ name:'台湾居民来往内地通行证', value:5 },{ name:'身份证', value:6 },{ name:'出入境通行证', value:7 }]
const CaseType=[{ name:'发热门诊', value:0 },{ name:'新入院', value:1 },{ name:'门急诊', value:2 },{ name:'在院', value:3 },
	{ name:'陪护人员', value:4 },{ name:'自愿', value:5 },{ name:'职工', value:6 },{ name:'体检', value:7 },{ name:'密接', value:8 },
	{ name:'次密接', value:9 },{ name:'黄码', value:10 },{ name:'红码', value:11 },{ name:'弹窗', value:12 },{ name:'应急采样', value:13 },
	{ name:'愿检尽检', value:14 }]
const SpecType=[{ name: '咽拭子', value: 0}, { name: '鼻咽拭子', value: 1}, { name: '咽拭子+鼻咽拭子', value: 2}, { name: '拭子', value: 3}]
const CheckType = [{ name:'人员', value:0 },{ name:'物表', value:1 }]
const MultipleType = [{ name:'单采', value:0 },{ name:'混采', value:1 }]
const SpecTraits = [{ name:'脂浊', value:'0' },{ name:'轻度溶血', value:'1' },{ name:'未见异常', value:'2' }]
const Sex = [{ name:'未知', value:0 },{ name:'男', value:1 },{ name:'女', value:2 }]
const BoolStatus = [{ name:'是', value: 1 }, { name:'否', value:0 }]
const nowTime = Date.now()
function patientFormData(){
	return [
	{ label:'标本条码', 			name:'specCode', 			full:true,	required:true, },
	{ label:'送检单位', 			name:'hospId', 				full:true,	type:'select', 	required:true,			idStr:'uuid',		nameStr:'hospName'	},
	{ label:'姓名', 			name:'patientName', 		half:true,	required:true,	itemClassName:'patient_name'},
	{ label:'性别', 			name:'sex',					half:true, 	type:'select',	value: 1,	data:Sex },
	{ label:'年龄', 			name:'age', 				half:true},
	{ label:'送检科室', 			name:'departmentName', 		half:true},
	{ label:'床号', 			name:'bedNo', 				half:true},
	{ label:'门诊/住院号', 		name:'outpatient', 			half:true},
	{ label:'送检医生', 			name:'doctor', 				half:true},
	{ label:'医生电话', 			name:'doctorPhone', 		half:true},
	{ label:'受检人电话', 		name:'patientPhone', 		half:true},
	{ label:'受检人类型', 		name:'caseType', 			half:true,	type:'select',	 data:CaseType,		value:14,		required:true },
	{ label:'标本性状', 			name:'specTraits', 			half:true,	type:'select',	data:SpecTraits,	value:'2' },
	{ label:'采集类型',			name:'isMultiple', 			half:true, 	type: 'radio', 	mode:'button',	data:MultipleType, value:0, disabled: true },
	{ label:'标本类型', 			name:'specType', 			half:true, 	type:'select',	data:SpecType,	value:0 },
	{ label:'受检类型',			name:'checkType', 			half:true, 	type: 'radio', 	mode:'button',	data:CheckType,	value:0,	onValue:({value,formData})=>{
		if(+value === 1){
			window.$fn.getRow(formData, 'cardNo').required = false
		}else{
			window.$fn.getRow(formData, 'cardNo').required = true
		}
		this.setState({formData})
	} },
	{ label:'采样时间',			name:'collTime', 			full:true,	type:'date-time',	required:true, after: nowTime },
	{ label:'医院标识', 			name:'hospRemark', 			full:true},
	{ label:'证件类型', 			name:'cardType', 			full:true, 	type:'select',	data:CardType,	value:6 },
	{ label:'证件号', 			name:'cardNo', 				full:true,	required:true },
	{ label:'临床诊断', 			name:'clinicalDiagnosis', 	full:true},
	{ label:'医院说明', 			name:'hospText', 			full:true},
	{ label:'备注', 			name:'remark', 				full:true,	type:'textarea'},
]
} 
export { patientFormData, Status, CardType, CaseType, Sex, CheckType, MultipleType,BoolStatus } 